<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>小飞象-会员中心-基本资料</title>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_810097_mgs6xzz1oj.css">
    <link rel="stylesheet" href="../css/common/reset.css">
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/reset-layui.css">
    <link rel="stylesheet" href="../css/header.css">
    <link rel="stylesheet" href="../css/common/nav.css">
    <link rel="stylesheet" href="../css/common/aside.css">
    <link rel="stylesheet" href="../css/common/content.css">
    <link rel="stylesheet" href="../css/baseInfo.css">
</head>

<body>
    <header>
        <div class="wrapper">
            <div class="clearfix headerBox">
                <h1 class="fl logo">
                    <a href="">小飞象</a>
                </h1>
                <!-- <div class="fl alipayName">支付宝充值账号: <b class="redColor">156****8656</b>开户人: <b class="redColor">陈小窝</b></div> -->
                <div class="fr logOut">退出</div>
                <div class="fr userName"></div>
            </div>
        </div>
    </header>
    <div class="mhNav">
        <ul class="navMenuBox">
            <li>
                <a href="../index.html">
                    飞象首页
                </a>
            </li>
            <li class="memberUser">
                <a href="javascript:;" class="active">
                    会员中心
                    <!-- <i class="iconfont icon-arrow-up mhArrowIcon"></i>
                    <i class="iconfont icon-arrow-down mhArrowIcon"></i> -->
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="basicInfo.html">基本资料</a>
                    </li>
                    <li>
                        <a href="storeMage.html">店铺管理</a>
                    </li>
                    <li>
                        <a href="/goodsMage.html">商品管理</a>
                    </li>
                    <li>
                        <a href="readjustNum.html">调整单量</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    计划管理
                    <!-- <i class="iconfont icon-arrow-up mhArrowIcon"></i>
                    <i class="iconfont icon-arrow-down mhArrowIcon"></i> -->
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../plan/newPlan.html">新建计划</a>
                    </li>
                    <li>
                        <a href="../plan/planMage.html">计划管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    订单管理
                    <!-- <i class="iconfont icon-arrow-up mhArrowIcon"></i>
                    <i class="iconfont icon-arrow-down mhArrowIcon"></i> -->
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../order/orderMage.html">订单管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    资金管理
                    <!-- <i class="iconfont icon-arrow-up mhArrowIcon"></i>
                    <i class="iconfont icon-arrow-down mhArrowIcon"></i> -->
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../capital/inAccout.html">账号充值</a>
                    </li>
                    <li>
                        <a href="../capital/transferMage.html">转账管理</a>
                    </li>
                    <li>
                        <a href="../capital/orderMage/dailyTaskDes.html">订单信息</a>
                    </li>
                    <li>
                        <a href="../capital/expressForm.html">获取快递底单</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="">在线客服</a>
            </li>
        </ul>
    </div>
    <div class="clearfix wrapper mainBomContent">
        <!-- 会员中心-基本资料 -->
        <div class="asideMenu">
            <h2 class="title">
                <i class="iconfont icon--"></i> 会员中心
            </h2>
            <ul>
                <li class="active">
                    <a href="basicInfo.html">基本资料</a>
                </li>
                <li>
                    <a href="storeMage.html">店铺管理</a>
                </li>
                <li>
                    <a href="readjustNum.html">调整单量</a>
                </li>
                <li>
                    <a href="/goodsMage.html">商品管理</a>
                </li>
            </ul>
        </div>
        <div class="rightContent">
            <div class="baseInfoView">
                <ul>
                    <li>会员名：<b class="loginName"></b></li>
                    <li>总资产：<b class="totalAssets"></b></li>
                    <li>登录密码：<b class="userPassword"></b><span class="fEditPwd">修改</span></li>
                    <li>支付密码：<b class="payPassword"></b><span class="fEditAlipay">修改</span></li>
                    <li>QQ：<b class="qq"></b><span class="fEditQQ">修改</span></li>
                    <li>微信：<b class="wx"></b><span class="fEditWechat">修改</span></li>
                </ul>
            </div>
        </div>
    </div>
    <script src="../js/jquery.min.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script>
        var mid = $.cookie('id');
        if (!mid) {
            window.location.href = "/login.html";
        }
        $(".mhNav .navMenuBox > li > a").click(function (event) {
            if ($(this).siblings('ul').is(':visible')) {
                $(this).siblings('ul').stop(true, true).slideUp();
                $(this).removeClass('active')
            } else {
                $(this).siblings('ul').stop(true, true).slideDown().parents('li').siblings().find('ul').stop(true, true).slideUp();
                $(this).addClass('active').parents('li').siblings().find('a').removeClass('active');
            }
        });
        layui.use('layer', function () {
            var layer = layui.layer;
            $(".fEditPwd").click(function () {
                layer.open({
                    type: 2 //此处以iframe举例
                    , title: '登录密码修改'
                    , area: ['500px', '245px']
                    , shadeClose: true //开启遮罩关闭
                    , offset: 'auto'
                    , resize: false
                    , scrollbar: false
                    , maxmin: false
                    , content: ['baseInfo/editPwd.html', 'no']
                    , btn2: function () {
                        layer.closeAll();
                    }
                    , zIndex: layer.zIndex //重点1
                });
            });
            $(".fEditAlipay").click(function () {
                layer.open({
                    type: 2 //此处以iframe举例
                    , title: '支付密码修改'
                    , area: ['500px', '245px']
                    , shadeClose: true //开启遮罩关闭
                    , offset: 'auto'
                    , resize: false
                    , scrollbar: false
                    , maxmin: false
                    , content: ['baseInfo/editAlipay.html', 'no']
                    , btn2: function () {
                        layer.closeAll();
                    }
                    , zIndex: layer.zIndex //重点1
                });
            });
            $(".fEditQQ").click(function () {
                layer.open({
                    type: 2 //此处以iframe举例
                    , title: 'QQ修改'
                    , area: ['500px', '187px']
                    , shadeClose: true //开启遮罩关闭
                    , offset: 'auto'
                    , resize: false
                    , scrollbar: false
                    , maxmin: false
                    , content: ['baseInfo/editQQ.html', 'no']
                    , btn2: function () {
                        layer.closeAll();
                    }
                    , zIndex: layer.zIndex //重点1
                });
            });
            $(".fEditWechat").click(function () {
                layer.open({
                    type: 2 //此处以iframe举例
                    , title: '微信修改'
                    , area: ['500px', '187px']
                    , shadeClose: true //开启遮罩关闭
                    , offset: 'auto'
                    , resize: false
                    , scrollbar: false
                    , maxmin: false
                    , content: ['baseInfo/editwechat.html', 'no']
                    , btn2: function () {
                        layer.closeAll();
                    }
                    , zIndex: layer.zIndex //重点1
                });
            });
            $.ajax({
                type: "get",
                url: "http://47.92.174.143:8888/v1/client/merchants/" + mid,
                dataType: 'json',
                success: function (data) {
                    console.log("请求数据为", data.data)
                    // 存储总额
                    if (data.data == null || !data.data) {
                        layer.msg('数据出错,请重新登录', {
                            icon: 5,//提示的样式
                            time: 6000, //6秒关闭（如果不配置，默认是3秒）//设置后不需要自己写定时关闭了，单位是毫秒
                            end: function () {
                                location.href = '/login.html';
                            }
                        });
                    } else {
                        $.cookie("totalAssets", data.data.totalAssets, { path: '/' });
                        $(".loginName").html(data.data.loginId);
                        $(".userName").html(data.data.loginId);
                        $(".totalAssets").html(data.data.totalAssets);
                        var userPassword = data.data.userPassword;
                        var payPassword = data.data.payPassword;
                        var boundQq = data.data.boundQq;
                        var boundWechat = data.data.boundWechat;
                        console.log("登录密码", userPassword);
                        if (userPassword == null || userPassword == "" || userPassword == undefined) {
                            $(".userPassword").html("未设置");
                        } else {
                            $(".userPassword").html("已设置");
                        }
                        if (payPassword == null || payPassword == "" || payPassword == undefined) {
                            $(".payPassword").html("未设置");
                        } else {
                            $(".payPassword").html("已设置");
                        }
                        if (!boundQq) {
                            $(".qq").html("未设置");
                        } else {
                            $(".qq").html(boundQq);
                        }
                        if (!boundWechat) {
                            $(".wx").html("未设置");
                        } else {
                            $(".wx").html(boundWechat);
                        }
                        // $(".qq").html(data.data.boundQq);
                        // $(".wx").html(data.data.boundWechat);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    // console.log(XMLHttpRequest);
                    // console.log(textStatus);
                    // console.log(errorThrown);
                }
            });
        })
    </script>
</body>

</html>